<template>
  <a-modal
    title="指标计算公式明细"
    :width="900"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @ok="handleSubmit"
    @cancel="handleCancel"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item>
        <a-form-item
          label="函数名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <span>{{ record.name }}</span>
        </a-form-item>
        <!--        <a-form-item-->
        <!--          label="函数描述信息"-->
        <!--          :labelCol="labelCol"-->
        <!--          :wrapperCol="wrapperCol"-->
        <!--          has-feedback-->
        <!--        >-->
        <!--          <span>{{ record.msg }}</span>-->
        <!--        </a-form-item>-->
        <a-form-item
          label="函数公式信息"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <span>{{ record.functionMsg }}</span>
        </a-form-item>
        <a-form-item
          label="函数计算公式"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
        >
          <img :src="record.imageUrl" alt="图片"/>
        </a-form-item>
      </a-form>
    </a-spin>
  </a-modal>
</template>

<script>
  // import { biIndexFunctionEdit } from '@/api/modular/main/biindexfunction/biIndexFunctionManage'
  export default {
    data () {
      return {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 15 }
        },
        visible: false,
        confirmLoading: false,
        form: {},
        imageUrl: '',
        record: {}
      }
    },
    methods: {
      // 初始化方法
      detail (record) {
        this.visible = true
        this.record = record
      },
      handleSubmit () {
        this.visible = false
      },
      handleCancel () {
        this.visible = false
      }
    }
  }
</script>
